package com.unhz.taigu.service.impl;

import com.unhz.generator.dao.ProductionOrderInfoMapper;
import com.unhz.generator.pojo.ProductionOrderInfo;
import com.unhz.taigu.service.ProductionOrderInfoService;
import com.unhz.taigu.service.ProductionOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: 沈佳庆
 * @Description:
 * @Date: Created in 上午 11:28 2018/3/3 0003
 * @Modified By: V1.0.0
 */
@Service
public class ProductionOrderInfoServiceImpl implements ProductionOrderInfoService {

    @Autowired
    private ProductionOrderInfoMapper productionOrderInfoMapper;

    @Override
    public List<ProductionOrderInfo> selectByOrderId(Long productionId) {
        return productionOrderInfoMapper.selectByOrderId(productionId);
    }

    @Override
    public List<ProductionOrderInfo> selectByOrderkeyId(Long productionId) {
        List<ProductionOrderInfo> list=new ArrayList<ProductionOrderInfo>();
        ProductionOrderInfo k=productionOrderInfoMapper.selectByPrimaryKey(productionId);
        list.add(k);
        return list;
    }

    @Override
    public void insert(ProductionOrderInfo productionOrderInfo) {
        productionOrderInfoMapper.insertSelective(productionOrderInfo);
    }

    @Override
    public int updateProductionInfo(ProductionOrderInfo productionOrderInfo) {
        return productionOrderInfoMapper.updateProductionInfo(productionOrderInfo);
    }

    @Override
    public void deleteProductionInfo(Long productOrderId) {
        productionOrderInfoMapper.deleteByProductOrderId(productOrderId.intValue());
    }


}
